﻿//    CMake Classifier:  Syntax coloring and highlighting Visual Studio Extension
//    Copyright (C) 2011 Steven Velez
//
//    This file is part of CMake Classifier
//
//    CMake Classifier is free software: you can redistribute it and/or modify
//    it under the terms of the GNU Lesser General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System.ComponentModel.Composition;
using System.Windows.Media;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;

namespace CMakeClassifier
{
    #region Format definition

    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "CMakeCommand")]
    [Name("CMakeCommand")]
    [UserVisible(true)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class CMakeCommandFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "CMakeClassifier" classification type
        /// </summary>
        public CMakeCommandFormat()
        {
            this.DisplayName = Properties.Resources.CommandFormatDisplayName; //human readable version of the name
            this.ForegroundColor = Colors.BlueViolet;
        }
    }

    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "CMakeVariable")]
    [Name("CMakeVariable")]
    [UserVisible(true)]
    [Order(Before = Priority.Default)]
    internal sealed class CMakeVariableFormat : ClassificationFormatDefinition
    {
        public CMakeVariableFormat()
        {
            this.DisplayName = Properties.Resources.VariableFormatDisplayName;
        }
    }

    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "CMakeAtVariable")]
    [Name("CMakeAtVariable")]
    [UserVisible(true)]
    [Order(Before = Priority.Default)]
    internal sealed class CMakeAtVariableFormat : ClassificationFormatDefinition
    {
        public CMakeAtVariableFormat()
        {
            this.DisplayName = Properties.Resources.AtVariableFormatDisplayName;
        }
    }

    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "CMakeSubstitution")]
    [Name("CMakeSubstitution")]
    [UserVisible(true)]
    [Order(Before = Priority.Default)]
    internal sealed class CMakeSubstitutionFormat : ClassificationFormatDefinition
    {
        public CMakeSubstitutionFormat()
        {
            this.DisplayName = Properties.Resources.SubstitutionFormatDisplayName;
            this.ForegroundColor = Colors.Maroon;
            this.BackgroundColor = Colors.WhiteSmoke;
        }
    }

    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "CMakeOperator")]
    [Name("CMakeOperator")]
    [UserVisible(true)]
    [Order(Before = Priority.Default)]
    internal sealed class CMakeOperatorFormat : ClassificationFormatDefinition
    {
        public CMakeOperatorFormat()
        {
            this.DisplayName = Properties.Resources.OperatorFormatDisplayName;
        }
    }
    #endregion //Format definition
}
